package com.hd.sup.modules.vehicle.wrapper;

import com.hd.common.constant.BizConstant;
import com.hd.common.page.BaseControllerWrapper;
import com.hd.common.utils.ValueUtils;
import com.hd.sup.modules.vehicle.utils.VehicleUtils;

import java.util.Map;

/**
 * @Project OPS设备运维平台
 * @Version: 1.0
 * @Author chentl
 * @Description: 车辆轨迹装饰器
 * @Pacakges: com.ops.modules.workflow.wrapper
 * @Create: 2020/12/8 0008 19:29
 */
public class VehicleTrailWrapper extends BaseControllerWrapper {

    public VehicleTrailWrapper(Object obj) {
        super(obj);
    }

    @Override
    protected void warpTheMap(Map<String, Object> map) {

        //上线时间
        Object vehicle_status = map.get("vehicle_status");
        if (vehicle_status != null) {
            map.put("vehicle_status", VehicleUtils.getVehicleStatusCN(ValueUtils.parseInteger(vehicle_status)));
        }

        //数据补报状态  0 实时 1 补报
        Object real_data = map.get("real_data");
        if (real_data != null) {
            map.put("real_data", BizConstant.RealData.get(ValueUtils.parseString(real_data)));
        }
    }
}